<?php
class PNUserTopicsArray extends PNObjectExArray {
  function PNUserTopicsArray($init=null, $where='')
  {
    $this->PNObject();

    $this->_objType       = 'icarrent_topics';
    $this->_objField      = 'id';
    $this->_objPath       = 'form';
    $this->_objColumnExArray = array( 'is_new'      => "IF ( DATEDIFF(DATE(tpc_cr_date),DATE(NOW())) <1 
                                                             AND
                                                             DATEDIFF(DATE(tpc_cr_date),DATE(NOW())) >-3,
                                                            'T','F')");

    $this->_objJoin[]     = array ( 'join_table'  =>  'icarrent_category',
                            'join_field'          =>  array('name'),
                            'object_field_name'   =>  array('category_name'),
                            'compare_field_table' =>  'category_id',
                            'compare_field_join'  =>  'id');

    $this->_objJoin[]     = array ( 'join_table'  =>  'icarrent_subcategory',
                            'join_field'          =>  array('name'),
                            'object_field_name'   =>  array('subcategory_name'),
                            'compare_field_table' =>  'subcategory_id',
                            'compare_field_join'  =>  'id');
    $this->_objJoin[]     = array ( 'join_table'  =>  'icarrent_brand',
                            'join_field'          =>  array('name'),
                            'object_field_name'   =>  array('brand_name'),
                            'compare_field_table' =>  'brand_id',
                            'compare_field_join'  =>  'id');
    $this->_objJoin[]     = array ( 'join_table'  =>  'icarrent_model',
                            'join_field'          =>  array('name'),
                            'object_field_name'   =>  array('model_name'),
                            'compare_field_table' =>  'model_id',
                            'compare_field_join'  =>  'id');
    $this->_objJoin[]     = array ( 'join_table'  =>  'icarrent_shop',
                            'join_field'          =>  array('name'),
                            'object_field_name'   =>  array('shop_name'),
                            'compare_field_table' =>  'shop_id',
                            'compare_field_join'  =>  'id');



    $this->_init($init, $where);
  }


}